import type { LoginResult } from '@/types/member'
import { http } from '@/utils/http'

type LoginWxMinParams = {
  code: string
  encryptedData?: string
  iv?: string
}

export const postLoginWxMinAPI = (data: LoginWxMinParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/user/loginOrRegister',
    data,
  })
}

export const PostLoginByTel = (data: { tel: string }) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/user/loginByTel',
    data,
  })
}
